#ifndef _CONDITION_H
#define	_CONDITION_H
/*******************************************************************************
 ** Name: condition.hpp                                                       **
 ** Description:                         **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/ODS/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012 Open Design Strategies, LLC                       **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// $Id$// Created on March 16, 2010, 8:17 PM
// Modified $Date: 2011-11-24 00:07:02 -0700 (Thu, 24 Nov 2011) $ by $Author: unknown $
#define CONDITION_H_ID  "$Id: condition.hpp 63608 2011-11-24 07:07:02Z unknown $"
// Implements GOVT-14

#include <vector>

enum class condition
{
    normal, admg, adrain, mildbleed, seriousbleed, severebleed, bruised,
    blinded, brokenarm, brokenleg, concussion, coma, cowering, dazed,
    dead, deafened, entangled, exhausted, fatigued, flatfooted, grappled,
    helpless, nauseated, panicked, paralyzed, pinned, prone, shaken, shock,
    stable, stunned, unconscious, resting, dying, 
	// FX
	invisible, phased, eathyrial,

	// alternate/additional condition expansion (optional)
	sore, overheated, stroking, burned, cold, cyanotic, frostbitten, 
	confused, stupefied, depressed,	delusional, enthralled, infected, 
	intoxicated, 

	
	conditions
};

extern const char *  cond2str[];

struct ConditionNode
{
	condition	cond;
	boost::posix_time::ptime	expiration;

	ConditionNode() { }
	ConditionNode(condition c, boost::posix_time::ptime p = 0) {
		cond = c; expiration = p;
	}
};

class Condition
{
public:
	Condition() { }

	void	Add(condition c, boost::posix_time::ptime p = 0) {
		ConditionNode cn(c,p);
		conds.push_back(cn);
	}
	void	Remove(condition c) {
		std::vector<ConditionNode>::iterator i;
		for (i = conds.begin(); i != conds.end(); ++i) {
			if (*i->cond == c)
				conds.erase(i);
		}
	}

private:
	std::vector<ConditionNode>	conds;
};

#endif	/* _CONDITION_H */

